package com.turing.post.thirdinterface.impl;

import javax.ejb.Local;
import javax.ejb.Remote;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;

import com.turing.post.thirdinterface.util.MapIssueBranchDao;

@Stateless(mappedName = "thirdinterface.impl.MapIssueBranchDaoImpl")
@Remote
@Local
public class MapIssueBranchDaoImpl implements MapIssueBranchDao {

	/**
	 * 实体管理器
	 */
	@PersistenceContext
	protected EntityManager _em;

	@Override
	public String getIssueBrchNoFromMapIssueBranch(String branchNo) {
		String sql = "select t.issuebranchno from mapissuebranch t where t.branchno=?1";
		Query query = _em.createNativeQuery(sql);
		query.setParameter(1, branchNo);
		return (String) query.getSingleResult();
	}
}
